package com.cdtye.shuoh.mapper.product;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cdtye.shuoh.domain.product.entity.Product;
import com.cdtye.shuoh.domain.product.vo.ProductVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;


/**
 * 产品模型 Mapper 接口
 * @author 
 * @date 2022-12-21
 */
@Repository
public interface ProductMapper extends BaseMapper<Product> {
    /**
     * 根据生产厂家，model,设备类型查询产品管理
     *
     * @param manufacturerId
     * @param model
     * @param deviceType
     * @return
     */
    Product findOneByManufacturerIdAndModelAndDeviceType(@Param("manufacturerId") String manufacturerId, @Param("model") String model, @Param("deviceType") String deviceType);

    /**
     *
     * @param productIdentification
     * @param protocolType
     * @return
     */
    Product findOneByProductIdentificationAndProtocolType(@Param("productIdentification")String productIdentification, @Param("protocolType") String protocolType);

    /**
     * 分页查询
     * @param page
     * @param vo
     * @return
     */
    IPage<Product> pageList(Page page, @Param("vo") ProductVo vo);

    /**
     * 获取详情
     * @param id
     * @return
     */
    Product getById(@Param("id") String id);

    int updateProduct(@Param("vo")ProductVo vo);

    /**
     * 获取list
     * @param vo
     * @return
     */
    List<Product> selectList(@Param("vo")ProductVo vo);

    /**
     * 根据id删除
     * @param id
     * @return
     */
    int deleteById(String id);

    Map<String,Object> stateStatistic();
}
